package com.yuntongxun.ecdemo.voicechat.db;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DataBaseHelper extends SQLiteOpenHelper {

    private static int VERSION = 1;
    public final static String TOPIC="TOPIC";

    public DataBaseHelper(Context context, String name, CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    public DataBaseHelper(Context context, String name, int version) {
        this(context, name, null, version);
        VERSION = version;
    }

    public DataBaseHelper(Context context, String name) {
        this(context, name, VERSION);
    }

    //	初始化数据库信息
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table "+TOPIC+"(id INTEGER PRIMARY KEY AUTOINCREMENT,cid varchar(20),topic_info varchar(250),topic_type int)");

    }

    @Override
    // 数据库版本升级
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        // TODO Auto-generated method stub
        System.out.println("Upgrade The Old DataBase... " + oldVersion + " to " + newVersion);

    }

}
